// Copyright (C) Microsoft Corporation. All rights reserved.

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
// Copyright (C) Microsoft Corporation. All rights reserved.

using System.Windows.Forms;

namespace Microsoft.VSPowerToys.VSCmdShell
{

    /// <summary>
    /// This interface allows shell host implementations to interact with user.
    /// </summary>
    public interface IShellUI
    {

        /// <summary>
        /// This property should be set to true, if an application is running and
        /// input must be directed to KeyDown, KeyUp events of this interface
        /// </summary>
        bool ApplicationRunning
        {
            set;
            get;
        }

        /// <summary>
        /// Height of the current window in number of characters
        /// </summary>
        int WindowHeight
        {
            get;
        }

        /// <summary>
        /// Width of the current window in number of characters.
        /// </summary>
        int WindowWidth
        {
            get;
        }

        /// <summary>
        /// Writes a line containing provided text.
        /// </summary>
        /// <param name="value"></param>
        void WriteLine(string value);

        /// <summary>
        /// Writes the provided text to output
        /// </summary>
        /// <param name="value"></param>
        void Write(string value);

        /// <summary>
        /// Reads a line of user input.
        /// </summary>
        /// <returns></returns>
        string ReadLine();

        /// <summary>
        /// When ApplicationRunning property is true, this event will be raised as user is pressing a key.
        /// </summary>
        event KeyEventHandler KeyDown;

        /// <summary>
        /// When ApplicationRunning property is true, this event will be reaised as user stops pressings a key.
        /// </summary>
        event KeyEventHandler KeyUp;
    }
}
